package com.example.smartmallserver.demos.web.service.impl;

import com.example.smartmallserver.demos.web.pojo.Validate;
import com.example.smartmallserver.demos.web.service.CaptchaService;
import com.example.smartmallserver.demos.web.util.ValidateCodeUtil;
import org.springframework.stereotype.Service;

@Service
public class CaptchaServiceImpl implements CaptchaService {
    @Override
    public Validate createCaptcha() {
        Validate validate = ValidateCodeUtil.getRandomCode();//直接调用静态方法，返回验证码对象
        System.out.println(validate.getBase64Str()+"  "+validate.getValue());
        return validate;
    }
}
